x86/hvm: treat non-instruction fetch nested page faults also as read violations
authorTamas K Lengyel <tamas.lengyel@zentific.com>
Thu, 28 Aug 2014 14:03:26 +0000 (16:03 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 28 Aug 2014 14:03:26 +0000 (16:03 +0200)
commit401d5c5cc5a780cad160aa0e3c282c11ac11dd0c
tree51c912f7b7b0f46f91cea8800b9b11b3befde2d0
parent3d4d4f9336159f3f77a7b480ce9984fd3ff7949f
x86/hvm: treat non-instruction fetch nested page faults also as read violations

As pointed out by Jan Beulich in
http://lists.xen.org/archives/html/xen-devel/2014-08/msg01269.html:
"Read-modify-write instructions absolutely need to be treated as read
accesses, yet hardware doesn't guarantee to tell us so (they may
surface as just write accesses)." This patch addresses the issue in
both the VMX and the SVM side.

VMX: Treat all write data access violations also as read violations (in
     addition to those that were already reported as read violations).
SVM: Refine the meaning of read data access violations to distinguish
     between read/write and instruction fetch access violations.

With this patch both VMX and SVM specific nested page fault handling code reports violations the same way, thus abstracting the hardware specific behaviour from the layers above.

Suggested-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c